package com.okaysoft.ofb

import com.okaysoft.ofb.account.User

/**
 * 任务
 */
class Task {

    Device device  //设备
    User user //指派人
    Date assignDate//指派时间
    Type type  //任务类型
    Status status //任务状态
    String result//处理结果
    Date completeDate//完成时间
    String opticalcableName    //光缆段名称
    String opticalcableCodeStart    //光蕊序号
    String opticalcableCodeEnd    //光蕊序号
    String direction //方向
    String pair //配对端子
    String description //备注
    User completeUser//处理人
    String terminal

    static constraints = {
        completeUser(nullable: true)
        user(nullable: true)
        assignDate(nullable: true)
        opticalcableName nullable: true
        opticalcableCodeStart nullable: true
        opticalcableCodeEnd nullable: true
        direction nullable: true
        pair nullable: true
        description nullable: true
        result nullable: true
        completeDate nullable: true
        completeUser nullable: true
        terminal nullable: true
    }

    enum Type {
        // MELTING(0, '熔纤'),
       JUMPING(1, '跳纤'),
         /*TROUBLESHOOTING(2, '排障'),
        CHAIQIAN(3, '折纤'),
        GAIQIAN(4, '改纤'),*/
        OTHER(9, '其它')
        String label
        int id

        Type(int id, String label) {
            this.id = id
            this.label = label
        }
    }

    enum Status {
        NOTCOMPLETE(0, '未完成'),
        COMPLETE(1, '完成')
        String label
        int id
        Status (int id, String label) {
            this.id = id
            this.label = label
        }
    }
}
